package com.meituan.catering.management.order.biz.model;

import com.meituan.catering.management.order.api.http.model.enumeration.CateringOrderItemStatusEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * 订单子项实例BO定义
 */
@Data
public class CateringOrderItemBO {
    /**
     * 子类订单id
     */
    private Long id;
    /**
     * 版本号
     */
    private Integer version;
    /**
     * 子项订单状态
     */
    private CateringOrderItemStatusEnum status;
    /**
     * 序号
     */
    private String seqNo;
    /**
     * 订单数量信息
     */
    private final Quantity quantity = new Quantity();

    /**
     * 商品信息
     */
    private final ProductSnapshot productSnapshotOnPlace = new ProductSnapshot();
    /**
     * 商品做法信息
     */
    private final ProductMethodSnapshot productMethodSnapshotOnPlace = new ProductMethodSnapshot();

    /**
     * 订单子项加料
     */
    private  List<CateringOrderItemAccessoryBO> acc=new ArrayList<>();

    @Data
    @ApiModel("数量信息")
    public static class Quantity {

        @ApiModelProperty("当前数量")
        private BigDecimal latest;

        @ApiModelProperty("下单数量")
        private BigDecimal onPlace;

        @ApiModelProperty("出餐数量")
        private BigDecimal onProduce;
    }

    @Data
    @ApiModel("商品快照")
    public static class ProductSnapshot {

        @ApiModelProperty("物理ID")
        private Long id;

        @ApiModelProperty("商品名")
        private String name;

        @ApiModelProperty("单价")
        private BigDecimal unitPrice;

        @ApiModelProperty("计量单位")
        private String unitOfMeasure;

    }

    @Data
    @ApiModel("商品做法快照")
    public static class ProductMethodSnapshot {

        @ApiModelProperty("物理ID")
        private Long id;

        @ApiModelProperty("名称")
        private String name;

        @ApiModelProperty("分组名")
        private String groupName;
    }



}
